{% load humanize %}

<h3>{{ blocks|length|intcomma }} Add-on GUIDs with {{ total_adu|intcomma }} users:</h3>
 <ul class="guid_list">
  {% for block_obj in blocks %}
    <li>
      {{ block_obj.guid }}.
      {% if block_obj.addon %}
        <span class="addon-name">{{ block_obj.addon.name }}</span>
      {% endif %}

      {% if block_obj.current_adu is not None %}
        ({{ block_obj.current_adu }} users).
      {% endif %}

      {{ block_obj.review_listed_link }}
      {{ block_obj.review_unlisted_link }}
      {% if block_obj.id %}
        <span class="existing_block">[<a href="{% url 'admin:blocklist_block_change' block_obj.id %}">Edit Block</a>]</span>
      {% endif %}
      [<a href='#' class="select-versions-all-none all-versions">select all</a>]
      [<a href='#' class="select-versions-all-none">select none</a>]
      <ul>
        {% for version in block_obj.addon_versions %}
          <li data-version-id="{{ version.id }}">
          {% if version.id in widget.choices %}
            <label><input
              type="checkbox"
              name="changed_version_ids"
              value="{{ version.id }}"
              {% if version.id in widget.value %}checked{% endif %}
            > {{ verb }} {{ version.version }} {% if version.blockversion %}({{ version.blockversion.get_block_type_display }}){% endif %}</label>
          {% else %}
            <span>
              {{ version.version }} ({% if version.is_blocked %}{{ version.blockversion.get_block_type_display }}{% else %}&#x1F7E2; Not Blocked{% endif %})
              {% if version.blocklist_submission_id %}
                [<a href="{% url 'admin:blocklist_blocklistsubmission_change' version.blocklist_submission_id %}">Edit Submission</a>]
              {% endif %}
            </span>
          {% endif %}
          </li>
        {% endfor %}
      </ul>
    </li>
  {% endfor %}
</ul>
